﻿#pragma execution_character_set("utf-8")
#include "communicatenormaldelegate.h"
#include <QDebug>
//using namespace hmigsoapnamespace;

#include "../CommunicateDelegate/hmicommunicate.h"
#include "../CommunicateDelegate/filedata.h"
#include "hmicommondefine.h"

extern FileData fileData;
#define D_Debug_flag 0

CommunicateNormalDelegate::CommunicateNormalDelegate()
{
    hmiCommunicate = new HmiCommunicate;

//    findCount = 0;
    ipNumber = 2;
//    findConnectTimer = new QTimer;
//    connect(findConnectTimer,SIGNAL(timeout()),this,SLOT(findConnectTimeWork()));

//    findFlag = true;
    isConnected=true;
    isLogIn=false;

    // fileData中程序文件操作gsoap对象初始化
    fileData.communicateNormalDelegate = this;
}

CommunicateNormalDelegate::~CommunicateNormalDelegate()
{
    qDebug()<<"CommunicateNormalDelegate::run() end";
    delete hmiCommunicate;
}

int CommunicateNormalDelegate::changeCurrentRobotId(int robotIdIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_changeCurrentRobotId(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,robotIdIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::changeCurrentRobotId = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getLaserCameraBufferMoveConfigParameter(BufferMoveConfig &paraOut)
{
    usingMutex.lock();
    bool returnFlag;

    if(soap_call_getLaserCameraBufferMoveConfigParameter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",
                           tmpUserInfo,paraOut) == SOAP_OK)
    {
        isConnected=true;
        returnFlag = true;
    }
    else
    {
        isConnected=false;
        if(D_Debug_flag)
        {
            qDebug("getLaserCameraBufferMoveConfigParameter:soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
        }

        returnFlag = false;
    }

    soap_destroy(&hmiCommunicate->client_soap);//必须
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return returnFlag;
}

int CommunicateNormalDelegate::setLaserCameraBufferMoveConfigParameter(BufferMoveConfig paraIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setLaserCameraBufferMoveConfigParameter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,paraIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getBatteryPeakConfig = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getLaserTrackConfigParameter(LaserTrackConfig &paraOut)
{
    usingMutex.lock();
    bool returnFlag;

    if(soap_call_getLaserTrackConfigParameter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",
                           tmpUserInfo,paraOut) == SOAP_OK)
    {
        isConnected=true;
        returnFlag = true;
    }
    else
    {
        isConnected=false;
        if(D_Debug_flag)
        {
            qDebug("getLaserTrackConfigParameter:soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
        }

        returnFlag = false;
    }

    soap_destroy(&hmiCommunicate->client_soap);//必须
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return returnFlag;
}

int CommunicateNormalDelegate::setLaserTrackConfigParameter(LaserTrackConfig paraIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setLaserTrackConfigParameter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,paraIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getBatteryPeakConfig = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getControllerAllInformation( bool isContainIoData,
                                                           bool isContainAgvData, bool isContainPointCloud,
                                                           ControllerInformationAll &infoOut)
{
    usingMutex.lock();
    bool returnFlag;

    if(soap_call_getControllerAllInformation(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",
                           tmpUserInfo,isContainIoData,isContainAgvData,isContainPointCloud,infoOut) == SOAP_OK)
    {
        isConnected=true;
        returnFlag = true;
    }
    else
    {
        isConnected=false;
        if(D_Debug_flag)
        {
            qDebug("getControllerAllInformation:soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
        }

        returnFlag = false;
    }

    soap_destroy(&hmiCommunicate->client_soap);//必须
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return returnFlag;
}


int CommunicateNormalDelegate::addCircle(int idIn, std::vector<double> posIn, std::vector<double> centerIn,
                                         std::vector<double> normalIn, double vel, int turnsIn, int velTypeIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_addCircle(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,idIn,posIn,centerIn,normalIn,vel,turnsIn,velTypeIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getWeldDebugStatusInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::addProgramMoveCommand_hmi(std::vector<MoveParameter> tmpCommandVectorIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_addProgramMoveCommand_hmi(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,tmpCommandVectorIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getWeldDebugStatusInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;

}

int CommunicateNormalDelegate::getWeldDebugStatusInfo(WeldCraftStatusInfo &infoOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getWeldDebugStatusInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getWeldDebugStatusInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
    return tmpReturn;
}

int CommunicateNormalDelegate::weldDebugOperation(E_WELD_TEST typeIn, bool control, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_weldDebugOperation(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,typeIn,control,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::weldDebugOperation = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setWeldCollisionCheck(bool isCheck, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setWeldCollisionCheck(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,isCheck,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setWeldCollisionCheck = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setToolMass(int toolIndex, double mass, std::vector<double> center, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setToolMass(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,toolIndex,mass,center,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getBatteryPeakConfig = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getRobotCoordinateConfig(RobotCoordinateAxisConfig &configOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getRobotCoordinateConfig(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,configOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getBatteryPeakConfig = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setRobotCoordinateConfig(RobotCoordinateAxisConfig configIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setRobotCoordinateConfig(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,configIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getBatteryPeakConfig = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getBatteryPeakConfig(BatteryPeakConfig &configOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getBatteryPeakConfig(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,configOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getBatteryPeakConfig = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setBatteryPeakConfig(BatteryPeakConfig configIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setBatteryPeakConfig(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,configIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setBatteryPeakConfig = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getReflectLaserFilterParameter(int index, LaserFilterParameter &paraOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getReflectLaserFilterParameter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,index,paraOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getReflectLaserFilterParameter = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setReflectLaserFilterParameter(int index, LaserFilterParameter paraIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setReflectLaserFilterParameter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,index,paraIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setReflectLaserFilterParameter = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getReflectCalculateCommonParameter(ReflectCommonDetectPara &paraOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getReflectCalculateCommonParameter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,paraOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getReflectCalculateCommonParameter = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setReflectCalculateCommonParameter(ReflectCommonDetectPara paraIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setReflectCalculateCommonParameter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,paraIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setReflectCalculateCommonParameter = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getAmclDebugInfo(AmclDebugInfo &debugInfoOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getAmclDebugInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,debugInfoOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getAmclDebugInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getOdometer(int robotIdIn, OdemeterData &odemeterDataReturn)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getOdometer(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,robotIdIn,odemeterDataReturn) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getOdometer = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setEthernetIpAddress(std::string netNameIn, std::string ipIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setEthernetIpAddress(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,netNameIn,ipIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setEthernetIpAddress = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getVehicleMovingCaligrateInfo(VehicleMovingCaligrateInfo &infoOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getVehicleMovingCaligrateInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getVehicleMovingCaligrateInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setCalibrateWheelDiameter(double idealMovedLength, double actualMovedLength, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setCalibrateWheelDiameter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,idealMovedLength,actualMovedLength,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setCalibrateWheelDiameter = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setCalibrateWheelDistance(double idealMovedAngle, double actualMovedAngle, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setCalibrateWheelDistance(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,idealMovedAngle,actualMovedAngle,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setCalibrateWheelDistance = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setAmclPara(AmclDebugPara paraIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setAmclPara(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,paraIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setAmclPara = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getAmclPara(AmclDebugPara &paraOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getAmclPara(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,paraOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getAmclPara = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
   soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setSefetyCheck(E_SAFETY_CHECK typeIn, int isEnable, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setSefetyCheck(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,typeIn,isEnable,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setSefetyCheck = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getSefetyCheck(E_SAFETY_CHECK typeIn, int &checkStatusReturn)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getSefetyCheck(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,typeIn,checkStatusReturn) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getSefetyCheck = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setRollerMechanismConfig(RollerMechanismConfig configIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setRollerMechanismConfig(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,configIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setRollerMechanismConfig = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getRollerMechanismConfig(RollerMechanismConfig &configOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    int tmpSoapResult=soap_call_getRollerMechanismConfig(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                                         ,tmpUserInfo,configOut);
    if( tmpSoapResult== SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getRollerMechanismConfig = ok";
    }
    else
    {
        isConnected=false;
        qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setLiftMechanismConfig(LiftMechanismConfig configIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setLiftMechanismConfig(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,configIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setLiftMechanismConfig = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getLiftMechanismConfig(LiftMechanismConfig &configOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getLiftMechanismConfig(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,configOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getLiftMechanismConfig = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getEncoderValue_belt(int beltIndexIn, int &encoderValueOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getEncoderValue_belt(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,beltIndexIn,encoderValueOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getEncoderValue_belt = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getEncoderValue_vision( int visionIndexIn, int &encoderValueOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getEncoderValue_vision(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,visionIndexIn,encoderValueOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::soap_call_forceTrigCamera = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::forceConnectCamera(int visionIndex, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_forceConnectCamera(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,visionIndex,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::forceConnectCamera = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::forceTrigCamera(int visionIndexIn,int isHighIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_forceTrigCamera(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,visionIndexIn,isHighIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::soap_call_forceTrigCamera = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::clearMotorBatteryError(int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_clearMotorBatteryError(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::clearMotorBatteryError = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::clearMotorBatteryErrorByAxis(int asixId, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_clearMotorBatteryErrorByAxis(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,asixId,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::clearMotorBatteryErrorByAxis = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setRobotSingleAxisCaliberate(int asixId, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    int tmpCom=soap_call_setRobotSingleAxisCaliberate(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                          ,tmpUserInfo,asixId,returnFlag) ;
    if(tmpCom== SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::soap_call_setSingleCaliber = ok";
    }
    else
    {
        isConnected=false;
        qDebug()<<"tmpCom"<<tmpCom;
        qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setRobotAllAxisCaliberate(int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setRobotAllAxisCaliberate(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setAllRobotAxisCaliberate = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getCoupleControlInfo(std::vector<CoupleConfigParameter> &infoOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getCoupleControlInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getCoupleControlInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setAxisProperty(int axisId, AxisProperty_hmi axisPropertyIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setAxisProperty(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,axisId,axisPropertyIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setAxisProperty = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getAxisProperty(int axisId, AxisProperty_hmi &axisPropertyOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getAxisProperty(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,axisId,axisPropertyOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getAxisProperty = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setCoupleRelativeDistanceMonitorEnable(int followAxisId, bool isEnableIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setCoupleRelativeDistanceMonitorEnable(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,followAxisId,isEnableIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setCoupleControlEnable = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setCoupleControlEnable(int followAxisId, bool isEnableIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setCoupleControlEnable(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,followAxisId,isEnableIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setCoupleControlEnable = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getImageStringFormImagePath(std::string imagePathIn, std::string &imageStrOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getImageStringFormImagePath(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,imagePathIn,imageStrOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getImageStringFormImagePath = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setWeldVirtualMode(bool isVirtualControlIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setWeldVirtualMode(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,isVirtualControlIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getAgvBorderInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getWeldIsVirtualStatus(int &returnFlag)
{

    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getWeldIsVirtualStatus(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getAgvBorderInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getAgvBorderInfo(VehicleBorderInfo &infoOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getAgvBorderInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getAgvBorderInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setAgvBorderRectInfo(BorderRectInfo rectInfoIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setAgvBorderRectInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,rectInfoIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setAgvBorderRectInfo = ok";
    }
    else
    {
        returnFlag=-10000;
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getVehicleKinematicDimension(VehicleKinematicDimension &infoOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getVehicleKinematicDimension(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getVehicleKinematicDimension = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;

}

int CommunicateNormalDelegate::setVehicleKinematicDimension(VehicleKinematicDimension infoIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setVehicleKinematicDimension(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setVehicleKinematicDimension = ok";
    }
    else
    {
        returnFlag=-10000;
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getLaserScanParameter(int laserId, LaserScanParameterHmi &infoOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getLaserScanParameter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,laserId,infoOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getLaserCameraConfigParameter = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setLaserScanParameter(int laserId, LaserScanParameterHmi infoIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setLaserScanParameter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,laserId,infoIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setLaserScanParameter = ok";
    }
    else
    {
        returnFlag=-10000;
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getVehicleJogControlParameter(VehicleJogControlParameter &infoOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getVehicleJogControlParameter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getVehicleJogControlParameter = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setVehicleJogControlParameter(VehicleJogControlParameter infoIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setVehicleJogControlParameter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setVehicleJogControlParameter = ok";
    }
    else
    {
        returnFlag=-10000;
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getVehicleTrajectoryControlParameter(VehicleTrajectoryControlParameter &infoOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getVehicleTrajectoryControlParameter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getVehicleTrajectoryControlParameter = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setVehicleTrajectoryControlParameter(VehicleTrajectoryControlParameter infoIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setVehicleTrajectoryControlParameter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setVehicleTrajectoryControlParameter = ok";
    }
    else
    {
        returnFlag=-10000;
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getAgvSheftInfo(int id,BorderRectInfo &infoOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getAgvSheftInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,id,infoOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getAgvSheftInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setAgvSheftRectInfo(int id,BorderRectInfo rectInfoIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setAgvSheftRectInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,id,rectInfoIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setAgvSheftRectInfo = ok";
    }
    else
    {
        returnFlag=-10000;
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getVehiclePositionCalibrateInfo(VehiclePosition &infoOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getVehiclePositionCalibrateInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getVehiclePositionCalibrateInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getLaserCameraConfigParameter(LaserCameraConfigParameter &infoOut)
{
    usingMutex.lock();
    if(soap_call_getLaserCameraConfigParameter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoOut) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getLaserCameraConfigParameter = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::getLaserCameraStatus(LaserCameraStatusInfo &infoOut)
{
    usingMutex.lock();
    if(soap_call_getLaserCameraStatus(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoOut) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getLaserCameraStatus = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::setLaserCameraConfigParameter(LaserCameraConfigParameter parameter,
                                                             int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setLaserCameraConfigParameter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,parameter,returnFlag) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setLaserCameraConfigParameter = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::reconnectLaserCamera(int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_reconnectLaserCamera(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,returnFlag) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::reconnectLaserCamera = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::setLaserCameraWork(bool isWork, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setLaserCameraWork(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,isWork,returnFlag) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setLaserCameraWork = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::setLaserCameraJobId(int jobIdIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setLaserCameraJobId(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,jobIdIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setLaserCameraJobId = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::calculateLaserCameraFrame(std::vector<PointPro> tcpPointList,
                std::vector<PointPro> cameraPointList, LaserCameraCalibrateResult &resultOut)
{
    usingMutex.lock();
    if(soap_call_calculateLaserCameraFrame(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,tcpPointList,cameraPointList,resultOut) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::calculateLaserCameraFrame = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::getLaserCameraFrameInfo(LaserCameraFrameInfo &infoOut)
{
    usingMutex.lock();
    if(soap_call_getLaserCameraFrameInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoOut) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getLaserCameraFrameInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::getSocketFleetCommandLog(FleetCommandDebugInfo &fleetCommandLogOut)
{
    usingMutex.lock();
    if(soap_call_getSocketFleetCommandLog(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,fleetCommandLogOut) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getSocketFleetCommandLog = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::getModbusFleetCommandLog(FleetCommandDebugInfo &fleetCommandLogOut)
{
    usingMutex.lock();
    if(soap_call_getModbusFleetCommandLog(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,fleetCommandLogOut) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getModbusFleetCommandLog = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::getEncoderReciverDataList(std::vector<EncoderReceiverData> &dataListReturn)
{
    usingMutex.lock();
    if(soap_call_getEncoderReciverDataList(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,dataListReturn) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getEncoderReciverDataList = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::getBeltTrackDebugInfo(int index, BeltTrackDebugInfo &infoOut)
{
    usingMutex.lock();
    if(soap_call_getBeltTrackDebugInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,index,infoOut) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getBeltTrackDebugInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::getWeldConditionConfigList(std::vector<struct WeldCondition> &configListOut){
    usingMutex.lock();
    if(soap_call_getWeldConditionConfigList(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,configListOut) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getWeldConditionConfigList = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::changeWeldConditionConfigList(struct WeldCondition configIn,int &returnFlag){
    usingMutex.lock();
    if(soap_call_changeWeldConditionConfigList(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,configIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::changeWeldConditionConfigList = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}


int CommunicateNormalDelegate::getWeldPropertConfigList(std::vector<struct WeldProperty> &configListOut){
    usingMutex.lock();
    if(soap_call_getWeldPropertConfigList(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,configListOut) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getWeldPropertConfigList = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::changeWeldPropertConfigList(struct WeldProperty configIn,int &returnFlag){
    usingMutex.lock();
    if(soap_call_changeWeldPropertConfigList(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,configIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::changeWeldPropertConfigList = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::getWeldSystemInfo(struct WeldSystemInfo &weldSystemInfo){
    usingMutex.lock();
    if(soap_call_getWeldSystemInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,weldSystemInfo) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getWeldSystemInfo = ok";
    }
    else
    {
        isConnected=false;
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}
int CommunicateNormalDelegate::changeWeldSystemInfo(struct WeldSystemInfo configIn){
    usingMutex.lock();
    int returnFlag;
    if(soap_call_changeWeldSystemInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,configIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::changeWeldSystemInfo = ok";
    }
    else
    {
        isConnected=false;

    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::getPalletConditionInfo(std::vector<PalletMiddleInfo> &infoOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getPalletConditionInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getPalletConditionInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setPalletConditionInfo(StackInfo infoIn, int &returnFlag)
{
    qDebug()<<"stackPointA_nList"<<infoIn.stackPointA_nList.size()<<"stackPointR_nList"<<infoIn.stackPointR_nList.size();
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setPalletConditionInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::setPalletConditionInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getWeaveMotionConditionInfo(std::vector<WeaveMotionCondition> &infoOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getWeaveMotionConditionInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getWeaveMotionConditionInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setWeaveMotionConditionInfo(WeaveMotionCondition infoIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setWeaveMotionConditionInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getWeaveMotionConditionInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getVisionTrackDebugInfo(int index, VisionTrackDebugInfo &infoOut)
{
    usingMutex.lock();
    if(soap_call_getVisionTrackDebugInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,index,infoOut) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getVisionTrackDebugInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::getVisionTrackConfigList(std::vector<VisionTrackConfig> &configListOut)
{
    usingMutex.lock();
    if(soap_call_getVisionTrackConfigList(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,configListOut) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getVisionTrackConfigList = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::getBeltTrackConfigList(std::vector<BeltTrackConfig> &configListOut)
{
    usingMutex.lock();
    if(soap_call_getBeltTrackConfigList(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,configListOut) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getBeltTrackConfigList = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::changeVisionTrackConfig(int id, VisionTrackConfig configIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_changeVisionTrackConfig(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,id,configIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::changeVisionTrackConfig = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::changeBeltTrackConfig(int id, BeltTrackConfig configIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_changeBeltTrackConfig(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,id,configIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::changeBeltTrackConfig = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::getMapPropertyInfo(std::string mapName, MapPropertyInfo &infoOut)
{
    usingMutex.lock();
    if(soap_call_getMapPropertyInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,mapName,infoOut) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getMapPropertyInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::getFleetMap(std::string mapName, std::string &mapInfoReturn)
{
    usingMutex.lock();
    if(soap_call_getFleetMap(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,mapName,mapInfoReturn) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getFleetMap = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::writeFleetMap(std::string mapName, std::string &mapInfoIn)
{
    int returnFlag;
    usingMutex.lock();
    if(soap_call_writeFleetMap(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,mapName,mapInfoIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::writeFleetMap = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::calculateZeroOffset(std::vector<PointPro> pointList, AxisZeroOffsetInfo &returnInfo)
{
    usingMutex.lock();
    if(soap_call_calculateZeroOffset(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,pointList,returnInfo) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::calculateZeroOffset = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::calibrateRobotByOffset(std::vector<double> offsetIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_calibrateRobotByOffset(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,offsetIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::calibrateRobotByOffset = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

bool CommunicateNormalDelegate::isLogInStatus()
{
    return isLogIn;
}

int CommunicateNormalDelegate::getAllReferenceMarks(std::vector<ReflectMarkInfo> &reflectMarksOut)
{
    usingMutex.lock();
    if(soap_call_getAllReferenceMarks(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,reflectMarksOut) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getAllReferenceMarks = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::addReferenceMarkToMap(ReflectMarkInfo markIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_addReferenceMarkToMap(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,markIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::addReferenceMarkToMap = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::saveReferenceMarkToFile(std::string fileNameIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_saveReferenceMarkToFile(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,fileNameIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::saveReferenceMarkToFile = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::deleteReferenceMarkInMap(int uniqId, int &returnFlag)
{
    usingMutex.lock();
    returnFlag=-1;
    if(soap_call_deleteReferenceMarkInMap(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,uniqId,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::deleteReferenceMarkInMap = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::getReflectDebugInfo(ReflectDebugInfo &matchDebugInfoOut)
{
    usingMutex.lock();
    if(soap_call_getReflectDebugInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,matchDebugInfoOut) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getReflectDebugInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::setOriginalLaserFilterType(int typeIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setOriginalLaserFilterType(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,typeIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setOriginalLaserFilterType = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::getSafeCollisionInfo(int sensorType, CollisionPara &infoOut)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_getSafeCollisionInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,sensorType,infoOut) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getSafeCollisionInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::setSafeCollisionInfo(int sensorType, CollisionPara infoIn, int &returnFlag)
{
    int tmpReturn=0;
    usingMutex.lock();
    if(soap_call_setSafeCollisionInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,sensorType,infoIn,returnFlag) == SOAP_OK)
    {
        tmpReturn=1;
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setSafeCollisionInfo = ok";
    }
    else
    {
        returnFlag=-10000;
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return tmpReturn;
}

int CommunicateNormalDelegate::getRobotLogFileInfo(const int &robotIdIn, std::vector<Message> &messagesLogOut, int &returnFlag)
{
    usingMutex.lock();
    Q_UNUSED(robotIdIn);
    int result = soap_call_getRobotLogFileInfo(&hmiCommunicate->client_soap, (const char*)tmpServerIpArray.data(), "", tmpUserInfo, messagesLogOut);
    if(result == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getRobotLogFileInfo ==== true";
        returnFlag = SOAP_OK;
    }
    else
    {
        isConnected=false;
        qDebug()<<"CommunicateNormalDelegate::getRobotLogFileInfo ==== false";
        emit showFileOperatDialog_signal(EM_MSG_BOX_SURE_BTN, tr("警号"), tr("获取控制器日志信息失败\n通信失败!"));
        returnFlag = SOAP_ERR;
    }

    // 清理gsoap资源
    soap_destroy(&hmiCommunicate->client_soap);     // 清除反序列化的类实例
    soap_end(&hmiCommunicate->client_soap);         // 清理反序列化的数据(除类实例)和临时数据清理
    soap_done(&hmiCommunicate->client_soap);        // 重置和分离上下文:关闭网络连接和删除回调
    usingMutex.unlock();
    return returnFlag;
}

int CommunicateNormalDelegate::get__Control_DO_NameInfo(const int &robotIdIn, std::vector<std::string> &namesOut, int &returnFlag)
{
    usingMutex.lock();
    Q_UNUSED(robotIdIn);
    int result = soap_call_get_do_names_info(&hmiCommunicate->client_soap, (const char*)tmpServerIpArray.data(), "", tmpUserInfo, namesOut);
    if( result == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::get__Control_DO_NameInfo ==== true";
        returnFlag = SOAP_OK;
    }
    else
    {
        isConnected=false;
        qDebug()<<"CommunicateNormalDelegate::get__Control_DO_NameInfo ==== false";
        returnFlag = SOAP_ERR;
    }

    // 清理gsoap资源
    soap_destroy(&hmiCommunicate->client_soap);     // 清除反序列化的类实例
    soap_end(&hmiCommunicate->client_soap);         // 清理反序列化的数据(除类实例)和临时数据清理
    soap_done(&hmiCommunicate->client_soap);        // 重置和分离上下文:关闭网络连接和删除回调
    usingMutex.unlock();
    return returnFlag;
}

int CommunicateNormalDelegate::get__Control_DI_NameInfo(const int &robotIdIn, std::vector<std::string> &namesOut, int &returnFlag)
{
    usingMutex.lock();
    Q_UNUSED(robotIdIn);
    if(soap_call_get_di_names_info(&hmiCommunicate->client_soap, (const char*)tmpServerIpArray.data(), "", tmpUserInfo, namesOut) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::get__Control_DI_NameInfo ==== true";
        returnFlag = SOAP_OK;
    }
    else
    {
        isConnected=false;
        qDebug()<<"CommunicateNormalDelegate::get__Control_DI_NameInfo ==== false";
        returnFlag = SOAP_ERR;
    }

    // 清理gsoap资源
    soap_destroy(&hmiCommunicate->client_soap);     // 清除反序列化的类实例
    soap_end(&hmiCommunicate->client_soap);         // 清理反序列化的数据(除类实例)和临时数据清理
    soap_done(&hmiCommunicate->client_soap);        // 重置和分离上下文:关闭网络连接和删除回调
    usingMutex.unlock();
    return returnFlag;
}

int CommunicateNormalDelegate::get__Control_AO_NameInfo(const int &robotIdIn, std::vector<std::string> &namesOut, int &returnFlag)
{
    usingMutex.lock();
    Q_UNUSED(robotIdIn);
    if(soap_call_get_ao_names_info(&hmiCommunicate->client_soap, (const char*)tmpServerIpArray.data(), "", tmpUserInfo, namesOut) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::get__Control_AO_NameInfo ==== true";
        returnFlag = SOAP_OK;
    }
    else
    {
        isConnected=false;
        qDebug()<<"CommunicateNormalDelegate::get__Control_AO_NameInfo ==== false";
        returnFlag = SOAP_ERR;
    }

    // 清理gsoap资源
    soap_destroy(&hmiCommunicate->client_soap);     // 清除反序列化的类实例
    soap_end(&hmiCommunicate->client_soap);         // 清理反序列化的数据(除类实例)和临时数据清理
    soap_done(&hmiCommunicate->client_soap);        // 重置和分离上下文:关闭网络连接和删除回调
    usingMutex.unlock();
    return returnFlag;
}

int CommunicateNormalDelegate::get__Control_AI_NameInfo(const int &robotIdIn, std::vector<std::string> &namesOut, int &returnFlag)
{
    usingMutex.lock();
    Q_UNUSED(robotIdIn);
    if(soap_call_get_ai_names_info(&hmiCommunicate->client_soap, (const char*)tmpServerIpArray.data(), "", tmpUserInfo, namesOut) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::get__Control_AI_NameInfo ==== true";
        returnFlag = SOAP_OK;
    }
    else
    {
        isConnected=false;
        qDebug()<<"CommunicateNormalDelegate::get__Control_AI_NameInfo ==== false";
        returnFlag = SOAP_ERR;
    }

    // 清理gsoap资源
    soap_destroy(&hmiCommunicate->client_soap);     // 清除反序列化的类实例
    soap_end(&hmiCommunicate->client_soap);         // 清理反序列化的数据(除类实例)和临时数据清理
    soap_done(&hmiCommunicate->client_soap);        // 重置和分离上下文:关闭网络连接和删除回调
    usingMutex.unlock();
    return returnFlag;
}

int CommunicateNormalDelegate::get__Control_SO_NameInfo(const int &robotIdIn, std::vector<std::string> &namesOut, int &returnFlag)
{
    usingMutex.lock();
    Q_UNUSED(robotIdIn);
    if(soap_call_get_so_names_info(&hmiCommunicate->client_soap, (const char*)tmpServerIpArray.data(), "", tmpUserInfo, namesOut) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::get__Control_SO_NameInfo ==== true";
        returnFlag = SOAP_OK;
    }
    else
    {
        isConnected=false;
        qDebug()<<"CommunicateNormalDelegate::get__Control_SO_NameInfo ==== false";
        returnFlag = SOAP_ERR;
    }

    // 清理gsoap资源
    soap_destroy(&hmiCommunicate->client_soap);     // 清除反序列化的类实例
    soap_end(&hmiCommunicate->client_soap);         // 清理反序列化的数据(除类实例)和临时数据清理
    soap_done(&hmiCommunicate->client_soap);        // 重置和分离上下文:关闭网络连接和删除回调
    usingMutex.unlock();
    return returnFlag;
}

int CommunicateNormalDelegate::get__Control_SI_NameInfo(const int &robotIdIn, std::vector<std::string> &namesOut, int &returnFlag)
{
    usingMutex.lock();
    Q_UNUSED(robotIdIn);
    if(soap_call_get_si_names_info(&hmiCommunicate->client_soap, (const char*)tmpServerIpArray.data(), "", tmpUserInfo, namesOut) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::get__Control_SI_NameInfo ==== true";
        returnFlag = SOAP_OK;
    }
    else
    {
        isConnected=false;
        qDebug()<<"CommunicateNormalDelegate::get__Control_SI_NameInfo ==== false";
                emit showFileOperatDialog_signal(EM_MSG_BOX_SURE_BTN, tr("警号"), tr("设置注释失败\n连接断开!"));
        returnFlag = SOAP_ERR;
    }

    // 清理gsoap资源
    soap_destroy(&hmiCommunicate->client_soap);     // 清除反序列化的类实例
    soap_end(&hmiCommunicate->client_soap);         // 清理反序列化的数据(除类实例)和临时数据清理
    soap_done(&hmiCommunicate->client_soap);        // 重置和分离上下文:关闭网络连接和删除回调
    usingMutex.unlock();
    return returnFlag;
}


int CommunicateNormalDelegate::set_Control_DO_NameInfo(const int &robotIdIn, const int &logicValueIndexIn, std::string nameIn, int &returnFlag)
{
    usingMutex.lock();
    Q_UNUSED(robotIdIn);
    if(soap_call_set_do_name_info(&hmiCommunicate->client_soap, (const char*)tmpServerIpArray.data(), "", tmpUserInfo, logicValueIndexIn, nameIn, returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::set_Control_DO_NameInfo ==== true";
        returnFlag = SOAP_OK;
    }
    else
    {
        isConnected=false;
        qDebug()<<"CommunicateNormalDelegate::set_Control_DO_NameInfo ==== false";
        emit showFileOperatDialog_signal(EM_MSG_BOX_SURE_BTN, tr("警号"), tr("设置注释失败\n连接断开!"));
        returnFlag = SOAP_ERR;
    }

    // 清理gsoap资源
    soap_destroy(&hmiCommunicate->client_soap);     // 清除反序列化的类实例
    soap_end(&hmiCommunicate->client_soap);         // 清理反序列化的数据(除类实例)和临时数据清理
    soap_done(&hmiCommunicate->client_soap);        // 重置和分离上下文:关闭网络连接和删除回调
    usingMutex.unlock();
    return returnFlag;
}

int CommunicateNormalDelegate::set_Control_DI_NameInfo(const int &robotIdIn, const int &logicValueIndexIn, std::string nameIn, int &returnFlag)
{
    usingMutex.lock();
    Q_UNUSED(robotIdIn);
    if(soap_call_set_di_name_info(&hmiCommunicate->client_soap, (const char*)tmpServerIpArray.data(), "", tmpUserInfo, logicValueIndexIn, nameIn, returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::set_Control_DI_NameInfo ==== true";
        returnFlag = SOAP_OK;
    }
    else
    {
        isConnected=false;
        qDebug()<<"CommunicateNormalDelegate::set_Control_DI_NameInfo ==== false";
                emit showFileOperatDialog_signal(EM_MSG_BOX_SURE_BTN, tr("警号"), tr("设置注释失败\n连接断开!"));
        returnFlag = SOAP_ERR;
    }

    // 清理gsoap资源
    soap_destroy(&hmiCommunicate->client_soap);     // 清除反序列化的类实例
    soap_end(&hmiCommunicate->client_soap);         // 清理反序列化的数据(除类实例)和临时数据清理
    soap_done(&hmiCommunicate->client_soap);        // 重置和分离上下文:关闭网络连接和删除回调
    usingMutex.unlock();
    return returnFlag;
}

int CommunicateNormalDelegate::set_Control_AI_NameInfo(const int &robotIdIn, const int &logicValueIndexIn, std::string nameIn, int &returnFlag)
{
    usingMutex.lock();
   // Set-AI-2018-12-3
    Q_UNUSED(robotIdIn);
    if(soap_call_set_ai_name_info(&hmiCommunicate->client_soap, (const char*)tmpServerIpArray.data(), "", tmpUserInfo, logicValueIndexIn, nameIn, returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::set_Control_AI_NameInfo ==== true";
        returnFlag = SOAP_OK;
    }
    else
    {
        isConnected=false;
        emit showFileOperatDialog_signal(EM_MSG_BOX_SURE_BTN, tr("警号"), tr("设置注释失败\n连接断开!"));
        qDebug()<<"CommunicateNormalDelegate::set_Control_AI_NameInfo ==== false";
        returnFlag = SOAP_ERR;
    }

    // 清理gsoap资源
    soap_destroy(&hmiCommunicate->client_soap);     // 清除反序列化的类实例
    soap_end(&hmiCommunicate->client_soap);         // 清理反序列化的数据(除类实例)和临时数据清理
    soap_done(&hmiCommunicate->client_soap);        // 重置和分离上下文:关闭网络连接和删除回调
    usingMutex.unlock();
    return returnFlag;
}

int CommunicateNormalDelegate::set_Control_SI_NameInfo(const int &robotIdIn, const int &logicValueIndexIn, std::string nameIn, int &returnFlag)
{
    usingMutex.lock();
   // Set-AI-2018-12-3
    Q_UNUSED(robotIdIn);
    if(soap_call_set_si_name_info(&hmiCommunicate->client_soap, (const char*)tmpServerIpArray.data(), "", tmpUserInfo, logicValueIndexIn, nameIn, returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::set_Control_SI_NameInfo ==== true";
        returnFlag = SOAP_OK;
    }
    else
    {
        isConnected=false;
        qDebug()<<"CommunicateNormalDelegate::set_Control_SI_NameInfo ==== false";
        emit showFileOperatDialog_signal(EM_MSG_BOX_SURE_BTN, tr("警号"), tr("设置注释失败\n连接断开!"));
        returnFlag = SOAP_ERR;
    }

    // 清理gsoap资源
    soap_destroy(&hmiCommunicate->client_soap);     // 清除反序列化的类实例
    soap_end(&hmiCommunicate->client_soap);         // 清理反序列化的数据(除类实例)和临时数据清理
    soap_done(&hmiCommunicate->client_soap);        // 重置和分离上下文:关闭网络连接和删除回调
    usingMutex.unlock();
    return returnFlag;
}

int CommunicateNormalDelegate::set_Control_SO_NameInfo(const int &robotIdIn, const int &logicValueIndexIn, std::string nameIn, int &returnFlag)
{
    usingMutex.lock();
   // Set-AI-2018-12-3
    Q_UNUSED(robotIdIn);
    if(soap_call_set_so_name_info(&hmiCommunicate->client_soap, (const char*)tmpServerIpArray.data(), "", tmpUserInfo, logicValueIndexIn, nameIn, returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::set_Control_SO_NameInfo ==== true";
        returnFlag = SOAP_OK;
    }
    else
    {
        isConnected=false;
        qDebug()<<"CommunicateNormalDelegate::set_Control_SO_NameInfo ==== false";
        emit showFileOperatDialog_signal(EM_MSG_BOX_SURE_BTN, tr("警号"), tr("设置注释失败\n连接断开!"));
        returnFlag = SOAP_ERR;
    }

    // 清理gsoap资源
    soap_destroy(&hmiCommunicate->client_soap);     // 清除反序列化的类实例
    soap_end(&hmiCommunicate->client_soap);         // 清理反序列化的数据(除类实例)和临时数据清理
    soap_done(&hmiCommunicate->client_soap);        // 重置和分离上下文:关闭网络连接和删除回调
    usingMutex.unlock();
    return returnFlag;

}

int CommunicateNormalDelegate::set_Control_AO_NameInfo(const int &robotIdIn, const int &logicValueIndexIn, std::string nameIn, int &returnFlag)
{
    usingMutex.lock();
    Q_UNUSED(robotIdIn);
    if(soap_call_set_ao_name_info(&hmiCommunicate->client_soap, (const char*)tmpServerIpArray.data(), "", tmpUserInfo, logicValueIndexIn, nameIn, returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::set_Control_AO_NameInfo ==== true";
        returnFlag = SOAP_OK;
    }
    else
    {
        isConnected=false;
        qDebug()<<"CommunicateNormalDelegate::set_Control_AO_NameInfo ==== false";
        emit showFileOperatDialog_signal(EM_MSG_BOX_SURE_BTN, tr("警号"), tr("设置注释失败\n连接断开!"));
        returnFlag = SOAP_ERR;
    }

    // 清理gsoap资源
    soap_destroy(&hmiCommunicate->client_soap);     // 清除反序列化的类实例
    soap_end(&hmiCommunicate->client_soap);         // 清理反序列化的数据(除类实例)和临时数据清理
    soap_done(&hmiCommunicate->client_soap);        // 重置和分离上下文:关闭网络连接和删除回调
    usingMutex.unlock();
    return returnFlag;
}

int CommunicateNormalDelegate::getAllIoNamesinfo(const int &robotIdIn, struct IOMapNamesInfo &namesInfo, int &returnFlag)
{
    usingMutex.lock();
    Q_UNUSED(robotIdIn);
    if(soap_call_getAllIoNamesinfo(&hmiCommunicate->client_soap, (const char*)tmpServerIpArray.data(), "", tmpUserInfo, namesInfo) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getAllIoNamesinfo ==== true";
        returnFlag = SOAP_OK;
    }
    else
    {
        isConnected=false;
        qDebug()<<"CommunicateNormalDelegate::getAllIoNamesinfo ==== false";
        emit showFileOperatDialog_signal(EM_MSG_BOX_SURE_BTN, tr("警号"), tr("获取远程控制器IO信息失败\n连接断开!"));
        returnFlag = SOAP_ERR;
    }

    // 清理gsoap资源
    soap_destroy(&hmiCommunicate->client_soap);     // 清除反序列化的类实例
    soap_end(&hmiCommunicate->client_soap);         // 清理反序列化的数据(除类实例)和临时数据清理
    soap_done(&hmiCommunicate->client_soap);        // 重置和分离上下文:关闭网络连接和删除回调
    usingMutex.unlock();
    return returnFlag;

}

int CommunicateNormalDelegate::get_robot_program_files_strings(int robotIdin, int languageId,
                                                               RunningProgramInfo &infoOut, int &returnFlag)
{
    usingMutex.lock();
    Q_UNUSED(robotIdin);

    if(soap_call_get_robot_program_files_strings(&hmiCommunicate->client_soap, (const char*)tmpServerIpArray.data(), "", tmpUserInfo, languageId, infoOut) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::get_robot_program_files_strings ==== true";
        qDebug()<<"CommunicateNormalDelegate,infoOut.programStrings.size()="<<infoOut.programStrings.size();

        // 通信成功，但数据为空
        if(infoOut.fileNames.empty())
        {
            returnFlag = -1;
        }
        else
        {
            returnFlag = SOAP_OK;

        }

    }
    else
    {
        returnFlag = -1;
        isConnected=false;
        qDebug()<<"CommunicateNormalDelegate::get_robot_program_files_strings ==== false";
    }

    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return returnFlag;
}

int CommunicateNormalDelegate::get_running_program_file_strings(int languageId, std::string fileName,
                                                                std::vector<std::string> &infoOut)
{
    usingMutex.lock();
    int returnFlag;
    if(soap_call_get_running_program_file_strings(&hmiCommunicate->client_soap, (const char*)tmpServerIpArray.data(), "", tmpUserInfo, languageId,fileName,
                                                  infoOut) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::get_running_program_file_strings ==== true";


        // 通信成功，但数据为空
        if(infoOut.empty())
        {
            returnFlag = -1;
        }
        else
        {
            returnFlag = SOAP_OK;

        }

    }
    else
    {
        returnFlag = -1;
        isConnected=false;
    }

    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return returnFlag;
}

int CommunicateNormalDelegate::getRobotProgramFileList(int robotIdIn, std::vector<std::string> &fileListOut, int &returnFlag)
{
    usingMutex.lock();
    Q_UNUSED(robotIdIn);
    int returnResult=soap_call_getRobotProgramFileList(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(), "", tmpUserInfo, fileListOut) ;
    if(SOAP_OK==returnResult)
    {
        returnFlag = SOAP_OK;
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getRobotProgramFileList = true";
    }
    else
    {
        returnFlag = -1;
        isConnected=false;
        qDebug()<<"CommunicateNormalDelegate::getRobotProgramFileList = true";
    }

    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return returnFlag;
}

int CommunicateNormalDelegate::removeRobotProgramFile(int robotIdIn, std::string fileName, int &returnFlag)
{
    usingMutex.lock();
    Q_UNUSED(robotIdIn);
    if(soap_call_removeRobotProgramFile\
            (&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(), "", tmpUserInfo, fileName, returnFlag) == SOAP_OK)
    {
        //　通讯成功，但是文件不存在时，删除失败，returnFlag返回-1,不操作
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::removeRobotProgramFile = true";
    }
    else
    {
        isConnected=false;
        qDebug()<<"CommunicateNormalDelegate::removeRobotProgramFile = false";
    }

    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::readRobotProgramFile(int robotIdIn, std::string fileName,
                                      std::vector<std::string> &fileStringListOut, int &returnFlag)
{
    usingMutex.lock();
    int result=soap_call_readRobotProgramFile(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                              ,tmpUserInfo,fileName, fileStringListOut) ;
    if(SOAP_OK==result)
    {
        isConnected=true;
        returnFlag = SOAP_OK;
        qDebug()<<"CommunicateNormalDelegate::readRobotProgramFile = returnFlag:" << returnFlag;
    }
    else
    {
        isConnected=false;
        emit showFileOperatDialog_signal(EM_MSG_BOX_SURE_BTN, tr("警号"), tr("读取远程用户程序文件失败\n请重试!"));
        returnFlag = -1;
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::writeRobotProgramFile(int robotIdIn, std::string fileName, std::vector<std::string> fileStringIn, int &returnFlag)
{
    usingMutex.lock();

    if(soap_call_writeRobotProgramFile(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,fileName, fileStringIn, returnFlag) == SOAP_OK)
    {
        isConnected=true;
//        emit showFileOperatDialog_signal(EM_MSG_BOX_SURE_BTN, tr("提示"), tr("文件写入成功!"));
        qDebug()<<"CommunicateNormalDelegate::writeRobotProgramFile = ok";
    }
    else
    {
        isConnected=false;
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;

}

int CommunicateNormalDelegate::setDefaultProgramFile(std::string inProgramName, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setDefaultProgramFile(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,inProgramName,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setDefaultProgramFile = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::setDefaultMapName(std::string fileNameIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setDefaultMapName(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,fileNameIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setDefaultMapName = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::setCheckVehiclePosition_amcl(bool isCheck, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setCheckVehiclePosition_amcl(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,isCheck,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setCheckVehiclePosition_amcl = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::setLaserIntensityFilterByType_visionMatch(int typeIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setLaserIntensityFilterByType_visionMatch(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,typeIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setUltrasonicSensorCheckEnable = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::setUltrasonicSensorCheckEnable(bool isOn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setUltrasonicSensorCheckEnable(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,isOn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setUltrasonicSensorCheckEnable = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::setPointCloudCheckEnable(bool isOn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setPointCloudCheckEnable(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,isOn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setPointCloudCheckEnable = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::moveToNavgationPoint(MovingToNavagationParameter parameterIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_moveToNavgationPoint(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,parameterIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::moveToNavgationPoint = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

//int CommunicateNormalDelegate::getVehiclePosition_specified(int typeIn, PositionInfo_hmi &positionReturn)
//{
//    if(soap_call_getVehiclePosition_specified(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
//                                     ,tmpUserInfo,typeIn,positionReturn) == SOAP_OK)
//    {
//        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getVehiclePosition_specified = ok";
//    }
//    else
//    {
//        isConnected=false;
//        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
//    }
//    soap_destroy(&hmiCommunicate->client_soap);
//    soap_end(&hmiCommunicate->client_soap);
//    soap_done(&hmiCommunicate->client_soap);
//}

int CommunicateNormalDelegate::setCurrentVMarkIndex(int indexIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setCurrentVMarkIndex(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,indexIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setCurrentVMarkIndex = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();return isConnected;
}

int CommunicateNormalDelegate::setCurrentVMarkType(int currentVmarkTypeIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setCurrentVMarkType(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,currentVmarkTypeIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getVmarkInfoList = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

<<<<<<< HEAD
//    findFlag = true;
    isConnected=true;
=======
int CommunicateNormalDelegate::getVmarkInfoList( std::vector<VMarkInfo> &vmarkInfoOut)
{
    if(soap_call_getVmarkInfoList(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,vmarkInfoOut) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getVmarkInfoList = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
>>>>>>> dev
}

int CommunicateNormalDelegate::updateVMarkFile(std::string vmarkFileIn, int &returnFlag)
{
    if(soap_call_updateVMarkFile(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,vmarkFileIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::updateVMarkFile = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

int CommunicateNormalDelegate::createVMark(VMarkInfo infoIn, std::string vmarkFileIn, int &returnFlag)
{
    if(soap_call_createVMark(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoIn,vmarkFileIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::createVMark = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

//int CommunicateNormalDelegate::getVMarkPositionInWorld(PositionInfo_hmi &positionReturn)
//{
//    if(soap_call_getVMarkPositionInWorld(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
//                                     ,tmpUserInfo,positionReturn) == SOAP_OK)
//    {
//        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getVMarkPositionInWorld = ok";
//    }
//    else
//    {
//        isConnected=false;
//        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
//    }
//    soap_destroy(&hmiCommunicate->client_soap);
//    soap_end(&hmiCommunicate->client_soap);
//    soap_done(&hmiCommunicate->client_soap);
//}

int CommunicateNormalDelegate::getMatchDebugInfo_vmark( VisionMatchDebugInfo &infoOut)
{
    if(soap_call_getMatchDebugInfo_vmark(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoOut) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getMatchDebugInfo_vmark = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

int CommunicateNormalDelegate::setLaserFilterByType_vmark(int typeIn, int &returnFlag)
{
    if(soap_call_setLaserFilterByType_vmark(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,typeIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setLaserFilterByType_vmark = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

bool CommunicateNormalDelegate::isConnectedStatus()
{
    return isConnected;
}

int CommunicateNormalDelegate::manual_stop( int &returnFlag)
{
    if(soap_call_manual_stop(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::manual_stop = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

int CommunicateNormalDelegate::clear_odomter(int &returnFlag)
{
    if(soap_call_clear_odomter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::clear_odomter = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

int CommunicateNormalDelegate::calibrateVehicle(double xOffset, double yOffset, double rOffset, int &returnFlag)
{
    if(soap_call_clear_odomter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::clear_odomter = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

int CommunicateNormalDelegate::setVehicleBorderOffset_rect(double front_offsetIn, double back_offsetIn, double left_offsetIn,
                                                           double right_offsetIn, int &returnFlag)
{
    if(soap_call_setVehicleBorderOffset_rect(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,front_offsetIn,back_offsetIn,left_offsetIn,right_offsetIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setVehicleBorderOffset_rect = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

//int CommunicateNormalDelegate::get_vehicle_basic_info(VehicleBasicInfo &basicInfoReturn)
//{
//    if(soap_call_get_vehicle_basic_info(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
//                                     ,tmpUserInfo,basicInfoReturn) == SOAP_OK)
//    {
//        isConnected=true;

////        qDebug()<<"CommunicateNormalDelegate::get_vehicle_basic_info = ok";
//    }
//    else
//    {
//        isConnected=false;
//        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
//    }
//    soap_destroy(&hmiCommunicate->client_soap);
//    soap_end(&hmiCommunicate->client_soap);
//    soap_done(&hmiCommunicate->client_soap);
//}

int CommunicateNormalDelegate::get_map_list(std::vector<std::string> &mapNameListReturn)
{
    if(soap_call_get_map_list(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,mapNameListReturn) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::get_map_list = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

int CommunicateNormalDelegate::getAllPointCloud_translated(std::vector<PointCloudData_3D> &pointCloudOut)
{
    if(soap_call_getAllPointCloud_translated(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,pointCloudOut) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getAllPointCloud_translated = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

int CommunicateNormalDelegate::getCarBorder(std::vector<VehiclePosition> &carBorderOut)
{
    if(soap_call_getCarBorder(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,carBorderOut) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getCarBorder = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

int CommunicateNormalDelegate::getCarBorderOffset(std::vector<VehiclePosition> &carBorderOffsetOut)
{
    if(soap_call_getCarBorderOffset(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,carBorderOffsetOut) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getCarBorderOffset = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

int CommunicateNormalDelegate::setDefaultProgramFile(std::string inProgramName, int &returnFlag)
{
    if(soap_call_setDefaultProgramFile(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,inProgramName,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setDefaultProgramFile = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

int CommunicateNormalDelegate::setDefaultMapName(std::string fileNameIn, int &returnFlag)
{
    if(soap_call_setDefaultMapName(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,fileNameIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setDefaultMapName = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

int CommunicateNormalDelegate::setCheckVehiclePosition_amcl(bool isCheck, int &returnFlag)
{
    if(soap_call_setCheckVehiclePosition_amcl(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,isCheck,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setCheckVehiclePosition_amcl = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

int CommunicateNormalDelegate::setLaserIntensityFilterByType_visionMatch(int typeIn, int &returnFlag)
{
    if(soap_call_setLaserIntensityFilterByType_visionMatch(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,typeIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setUltrasonicSensorCheckEnable = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

int CommunicateNormalDelegate::setUltrasonicSensorCheckEnable(bool isOn, int &returnFlag)
{
    if(soap_call_setUltrasonicSensorCheckEnable(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,isOn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setUltrasonicSensorCheckEnable = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

int CommunicateNormalDelegate::setPointCloudCheckEnable(bool isOn, int &returnFlag)
{
    if(soap_call_setPointCloudCheckEnable(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,isOn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setPointCloudCheckEnable = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

int CommunicateNormalDelegate::moveToNavgationPoint(MovingToNavagationParameter parameterIn, int &returnFlag)
{
    if(soap_call_moveToNavgationPoint(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,parameterIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::moveToNavgationPoint = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

//int CommunicateNormalDelegate::getVehiclePosition_specified(int typeIn, PositionInfo_hmi &positionReturn)
//{
//    if(soap_call_getVehiclePosition_specified(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
//                                     ,tmpUserInfo,typeIn,positionReturn) == SOAP_OK)
//    {
//        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getVehiclePosition_specified = ok";
//    }
//    else
//    {
//        isConnected=false;
//        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
//    }
//    soap_destroy(&hmiCommunicate->client_soap);
//    soap_end(&hmiCommunicate->client_soap);
//    soap_done(&hmiCommunicate->client_soap);
//}

int CommunicateNormalDelegate::setCurrentVMarkIndex(int indexIn, int &returnFlag)
{
    if(soap_call_setCurrentVMarkIndex(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,indexIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setCurrentVMarkIndex = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

int CommunicateNormalDelegate::setCurrentVMarkType(int currentVmarkTypeIn, int &returnFlag)
{
    if(soap_call_setCurrentVMarkType(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,currentVmarkTypeIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getVmarkInfoList = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}

int CommunicateNormalDelegate::getVmarkInfoList( std::vector<VMarkInfo> &vmarkInfoOut)
{
    usingMutex.lock();
    if(soap_call_getVmarkInfoList(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,vmarkInfoOut) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getVmarkInfoList = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::updateVMarkFile(std::string vmarkFileIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_updateVMarkFile(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,vmarkFileIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::updateVMarkFile = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::createVMark(VMarkInfo infoIn, std::string vmarkFileIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_createVMark(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoIn,vmarkFileIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::createVMark = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

//int CommunicateNormalDelegate::getVMarkPositionInWorld(PositionInfo_hmi &positionReturn)
//{
//    if(soap_call_getVMarkPositionInWorld(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
//                                     ,tmpUserInfo,positionReturn) == SOAP_OK)
//    {
//        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getVMarkPositionInWorld = ok";
//    }
//    else
//    {
//        isConnected=false;
//        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
//    }
//    soap_destroy(&hmiCommunicate->client_soap);
//    soap_end(&hmiCommunicate->client_soap);
//    soap_done(&hmiCommunicate->client_soap);
//}

int CommunicateNormalDelegate::getMatchDebugInfo_vmark( VisionMatchDebugInfo &infoOut)
{
    usingMutex.lock();
    if(soap_call_getMatchDebugInfo_vmark(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoOut) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getMatchDebugInfo_vmark = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getQrcodeDebugInfo(QrcodeDebugInfo &infoOut)
{
    usingMutex.lock();
    if(soap_call_getQrcodeDebugInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,infoOut) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getQrcodeDebugInfo = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setLaserFilterByType_vmark(int typeIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setLaserFilterByType_vmark(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,typeIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setLaserFilterByType_vmark = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

bool CommunicateNormalDelegate::isConnectedStatus()
{
    return isConnected;
}

int CommunicateNormalDelegate::manual_stop( int &returnFlag)
{
    qDebug()<<"CommunicateNormalDelegate::manual_stop";
    if(""==tmpServerIp)
    {
        qDebug()<<" failed:""==tmpServerIp";
        return false ;
    }
    if(false==isConnected)
    {
        qDebug()<<" failed:false==isConnected";
        return false ;
    }
    usingMutex.lock();
    if(soap_call_manual_stop(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::manual_stop = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::clear_odomter(int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_clear_odomter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::clear_odomter = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::calibrateVehicle(double xOffset, double yOffset, double rOffset, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_calibrateVehicle(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,xOffset,yOffset,rOffset,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::calibrateVehicle = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setVehicleBorderOffset_rect(double front_offsetIn, double back_offsetIn, double left_offsetIn,
                                                           double right_offsetIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setVehicleBorderOffset_rect(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,front_offsetIn,back_offsetIn,left_offsetIn,right_offsetIn,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setVehicleBorderOffset_rect = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

//int CommunicateNormalDelegate::get_vehicle_basic_info(VehicleBasicInfo &basicInfoReturn)
//{
//    if(soap_call_get_vehicle_basic_info(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
//                                     ,tmpUserInfo,basicInfoReturn) == SOAP_OK)
//    {
//        isConnected=true;

////        qDebug()<<"CommunicateNormalDelegate::get_vehicle_basic_info = ok";
//    }
//    else
//    {
//        isConnected=false;
//        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
//    }
//    soap_destroy(&hmiCommunicate->client_soap);
//    soap_end(&hmiCommunicate->client_soap);
//    soap_done(&hmiCommunicate->client_soap);
//}

int CommunicateNormalDelegate::get_map_list(std::vector<std::string> &mapNameListReturn)
{
    usingMutex.lock();
    if(soap_call_get_map_list(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,mapNameListReturn) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::get_map_list = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getAllPointCloud_translated(std::vector<PointCloudData_3D> &pointCloudOut)
{
    usingMutex.lock();
    if(soap_call_getAllPointCloud_translated(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,pointCloudOut) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getAllPointCloud_translated = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getCarBorder(std::vector<VehiclePosition> &carBorderOut)
{
    usingMutex.lock();
    if(soap_call_getCarBorder(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,carBorderOut) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getCarBorder = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getCarBorderOffset(std::vector<VehiclePosition> &carBorderOffsetOut)
{
    usingMutex.lock();
    if(soap_call_getCarBorderOffset(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,carBorderOffsetOut) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getCarBorderOffset = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}


int CommunicateNormalDelegate::getCarSpeed(double &speed)
{
    return isConnected;
}

int CommunicateNormalDelegate::getBatteryLeft(double &batteryData)
{
return isConnected;
}

int CommunicateNormalDelegate::getCarTask(QString &taskIn)
{

return isConnected;
}

int CommunicateNormalDelegate::getCarStatus(int &statusIn)
{
return isConnected;
}

int CommunicateNormalDelegate::getCarMode(int &carModeIn)
{
return isConnected;
}



int CommunicateNormalDelegate::vehicleJog(double xMove, double yMove, double rotate, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_vehicleAuto(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,1,xMove,yMove,rotate,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::vehicleJog = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setMapSolver(E_MAP_SOLVER solverIn, int laserCount, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setMapSolver(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,solverIn,laserCount,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::setMapSolver = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::createMapStart(int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_createMapStart(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::createMapStart = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::createMapEnd(std::string mapName, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_createMapEnd(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,mapName,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::createMapEnd = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::loadMap(std::string mapName, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_loadMap(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,mapName,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::loadMap = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::deleteMap(std::string mapName, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_deleteMap(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,mapName,returnFlag) == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::deleteMap = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getCurrentMapName(std::string &mapNameOut)
{
    usingMutex.lock();
    if(soap_call_getCurrentMapName(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,mapNameOut) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::getCurrentMapName = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;

}

int CommunicateNormalDelegate::addVitrualBlock(std::string configFilePath, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_addVitrualBlock(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,configFilePath,returnFlag) == SOAP_OK)
    {
        isConnected=true;
//        qDebug()<<"CommunicateNormalDelegate::addVitrualBlock = ok";
    }
    else
    {
        isConnected=false;
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::deleteVitrualBlock(int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_deleteVitrualBlock(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::deleteVitrualBlock = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::addForbidenZone(double x_start, double y_start, double x_end, double y_end, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_addForbidenZone(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,x_start,y_start,x_end,y_end,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::addForbidenZone = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setOdomSolver(E_ODOM_SOLVER solverIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setOdomSolver(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,solverIn,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::setOdomSolver = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setLocationSolver(E_LOCATION_SOLVER solverIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setLocationSolver(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,solverIn,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::setLocationSolver = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

<<<<<<< HEAD
int CommunicateNormalDelegate::getVehiclePosition(VehiclePosition &positionReturn)
{
    if(soap_call_getVehiclePosition(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,positionReturn) == SOAP_OK)
    {
//        qDebug()<<"CommunicateNormalDelegate::getVehiclePosition = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
}
=======
//int CommunicateNormalDelegate::getVehiclePosition(VehiclePosition &positionReturn)
//{
//    if(soap_call_getVehiclePosition(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
//                                     ,tmpUserInfo,positionReturn) == SOAP_OK)
//    {
////        qDebug()<<"CommunicateNormalDelegate::getVehiclePosition = ok";
//    }
//    else
//    {
//        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
//    }
//    soap_destroy(&hmiCommunicate->client_soap);
//    soap_end(&hmiCommunicate->client_soap);
//    soap_done(&hmiCommunicate->client_soap);
//}
>>>>>>> dev

int CommunicateNormalDelegate::setVehiclePosition(VehiclePosition positionIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setVehiclePosition(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,positionIn,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::setVehiclePosition = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setReplanCoutLimitWhenFailure(int countLimit, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setReplanCoutLimitWhenFailure(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,countLimit,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::setReplanCoutLimitWhenFailure = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setTrajectoryGlobalPlanSolver(E_TRAJECTORY_GLOBAL_SOLVER solverIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setTrajectoryGlobalPlanSolver(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,solverIn,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::setTrajectoryGlobalPlanSolver = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setTrajectoryLocalPlanSolver(E_TRAJECTORY_LOCAL_SOLVER solverIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setTrajectoryLocalPlanSolver(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,solverIn,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::setTrajectoryLocalPlanSolver = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::moveToPosition(VehiclePosition positionIn, double velocity, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_moveToPosition(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,positionIn,velocity,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::moveToPosition = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::moveFollowPath(std::vector<VehiclePosition> pathIn, double velocity, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_moveFollowPath(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,pathIn,velocity,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::moveFollowPath = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::changeVelocity(double velocity, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_changeVelocity(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,velocity,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::changeVelocity = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getMovingStatus(E_GOAL_STATUS &status)
{
    usingMutex.lock();
    if(soap_call_getMovingStatus(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,status) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::getMovingStatus = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getRemainningTime(double &timeOut)
{
    usingMutex.lock();
    if(soap_call_getRemainningTime(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,timeOut) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::getRemainningTime = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getRemainningDistance(double &distanceOut)
{
    usingMutex.lock();
    if(soap_call_getRemainningDistance(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,distanceOut) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::getRemainningDistance = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::ceaseMotion(int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_ceaseMotion(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::ceaseMotion = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::startMotion(int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_startMotion(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::startMotion = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::cancelMotion(int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_cancelMotion(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::cancelMotion = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setPositionArrivedAccuracy(double accuracyIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setPositionArrivedAccuracy(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                    ,tmpUserInfo ,accuracyIn,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::setPositionArrivedAccuracy = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setLocalPlanRange(double rangeIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setLocalPlanRange(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,rangeIn,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::setLocalPlanRange = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setVehicleBorderOffset(std::vector<double> point_x, std::vector<double> point_y, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setVehicleBorderOffset(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,point_x,point_y,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::setVehicleBorderOffset = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setGlobalBarrierOffset(double offsetIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setGlobalBarrierOffset(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,offsetIn,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::setGlobalBarrierOffset = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setLocalBarrierOffset(double offsetIn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setLocalBarrierOffset(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,offsetIn,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::setLocalBarrierOffset = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::resetRosAll(int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_resetRosAll(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::resetRosAll = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getRosPackageStatus(E_ROS_PACKAGE package, E_ROS_PACKAGE_STATUS &status)
{
    usingMutex.lock();
    if(soap_call_getRosPackageStatus(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),""
                                     ,tmpUserInfo,package,status) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::getRosPackageStatus = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::startImuCalibrate(int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_startImuCalibrate(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::startImuCalibrate = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::stopImuCalibrate(int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_stopImuCalibrate(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::stopImuCalibrate = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setMotorDcModeSlot(int value)
{
    usingMutex.lock();
    int returnFlag;
    if(soap_call_setEthercatMotorDcUserMode(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,1,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::setMotorDcModeSlot = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return isConnected;
}

int CommunicateNormalDelegate::clearMotorBatteryErrorSlot()
{
    usingMutex.lock();
    int returnFlag;
    if(soap_call_clearMotorBatteryError(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::clearMotorBatteryErrorSlot = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getEthercatSlavesInformationSlot()
{
    usingMutex.lock();
    std::vector<struct EcatBusDevInfo_gsoap> slavesInfo;
    if(soap_call_getEthercatSlavesInformation(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,slavesInfo) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::getEthercatSlavesInformationSlot = ok";
        emit showEthercatSlavesInformationSignal(slavesInfo);
    }
    else
    {

    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::writeEthercatDeviceAliasSlot(int nodeId, int alias)
{
    usingMutex.lock();
    int returnFlag;
    if(soap_call_setEthercatDeviceAlias(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,nodeId,alias,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::writeEthercatDeviceAliasSlot = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getDebugInfo_motionServerSlot()
{
    usingMutex.lock();
    MotionDebugInfo infoOut;
    if(soap_call_getMotionServerDebugInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",
                                          tmpUserInfo,infoOut) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::getDebugInfo_motionServerSlot = ok";
        emit showDebugInfo_motionServerSignal(infoOut);
    }
    else
    {

    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getDebugInfo_programEngineSlot()
{
    usingMutex.lock();
    std::vector<ProgramEngineDebugInfo> infoOut;
    if(soap_call_getProgramEngineDebugInfoList(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",
                                          tmpUserInfo,infoOut) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::getDebugInfo_programEngineSlot = ok";
        emit showDebugInfo_programEngineSignal(infoOut);
    }
    else
    {

    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getTaskInfoSlot()
{
    usingMutex.lock();
    TaskManagerInfo taskManagerInfo;
    if(soap_call_getTaskInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",
                                          tmpUserInfo,taskManagerInfo) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::getTaskInfoSlot = ok";
        emit showTaskInfoSignal(taskManagerInfo);
    }
    else
    {

    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getCalibrateInformation(S_AXISGROUP_ZERO_INFORMATION &zeroInformationOut)
{
    usingMutex.lock();

    if(soap_call_getCalibrateInformation(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,zeroInformationOut) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::showCalibrateInfoSlot = ok";

    }
    else
    {

    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::restartNfsService(int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_restartNfsService(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",
                                    tmpUserInfo,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::restartNfsService = ok";
    }
    else
    {

    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getSdo(int robID,
              int axis
              ,int rObIndex
              ,int rObSubIndex
              ,LONG64 &rData )
{
    usingMutex.lock();
    int returnFlag=-1;
    if(soap_call_getSdo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,
                        robID,axis,rObIndex,rObSubIndex,rData) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::getSdo = ok";
        returnFlag=1;

    }
    else
    {
        returnFlag=-1;
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
    return returnFlag;
}

int  CommunicateNormalDelegate::setSdo(int robID, int axis
             , int wObIndex
             , int wObSubIndex
             , LONG64 wData
             , int wDataLen, int &returnFlag  )
{
    usingMutex.lock();
    int tmpRe=soap_call_setSdo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,
                               robID,axis,wObIndex,wObSubIndex,wData,wDataLen,returnFlag);
    if( tmpRe== SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::setSdo = ok";

    }
    else
    {
        qDebug()<<"CommunicateNormalDelegate::setSdo = failed"<<tmpRe;
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setAllManualServon(int nServOffOn, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setAllManualServon(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",
                                    tmpUserInfo,nServOffOn,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::setAllManualServon = ok";
    }
    else
    {

    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setAllRunModel(int runModel, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_setAllRunModel(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",
                                    tmpUserInfo,runModel,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::setAllRunModel = ok";
    }
    else
    {

    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::programAllRun(int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_programAllRun(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",
                                    tmpUserInfo,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::programAllRun = ok";
    }
    else
    {

    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::programAllCease(int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_programAllCease(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",
                                    tmpUserInfo,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::programAllCease = ok";
    }
    else
    {

    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::programAllReset(int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_programAllReset(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",
                                    tmpUserInfo,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::programAllReset = ok";
    }
    else
    {

    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getAllTaskInfo(std::vector<TaskManagerInfo> &taskManagerInfo)
{
    usingMutex.lock();
    if(soap_call_getAllTaskInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",
                                    tmpUserInfo,taskManagerInfo) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::getAllTaskInfo = ok";
    }
    else
    {

    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getDebugInfo_motionServer(MotionDebugInfo &infoOut)
{
    usingMutex.lock();

    if(soap_call_getMotionServerDebugInfo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",
                                          tmpUserInfo,infoOut) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::getDebugInfo_motionServerSlot = ok";
    }
    else
    {

    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}



int CommunicateNormalDelegate::pauseRunSlot()
{
    if(""==tmpServerIp)
    {
        return -1;
    }
    //qDebug()<<"****stop!";

    int returnResult=-1;
    usingMutex.lock();
    if(soap_call_programCease(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnResult) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate:: pauseRunSlot soap_call_programCease";
//        if(returnResult == 1)
//        {
//        }
//        else
//        {
//        }
    }
    else
    {
        //再次发送
        soap_call_programCease(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnResult);
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return returnResult;
}

int CommunicateNormalDelegate::stopRun()
{
    qDebug()<<"CommunicateNormalDelegate::stopRun soap_call_programReset";
    if(""==tmpServerIp)
    {
        return -1;
    }
    int returnResult=-1;

    usingMutex.lock();
    if(soap_call_programReset(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnResult) == SOAP_OK)
    {
//        if(returnResult == 1)
//        {
//        }
//        else
//        {
//        }
    }
    else
    {
        //再次发送
        soap_call_programReset(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnResult);
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return returnResult;
}

int CommunicateNormalDelegate::stopWatchDog()
{
    if(""==tmpServerIp)
    {
        return -1;
    }
    int returnResult=-1;
    usingMutex.lock();
    if(soap_call_manual_stop(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnResult) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::soap_call_manual_stop stopWatchDog= ok";
    }
    else
    {

    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return returnResult;
}


int CommunicateNormalDelegate::setManualServonSlot(int onOff)
{
    if(""==tmpServerIp)
    {
        return -1;
    }
    //qDebug()<<"servon:"<<onOff;
    int returnResult=-1;

    usingMutex.lock();
    if(soap_call_setManualServon(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,onOff,returnResult) == SOAP_OK)
    {

    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return returnResult;
}

int CommunicateNormalDelegate::runSlot()
{
    usingMutex.lock();
    int returnResult=-1;

    if(soap_call_programRun(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnResult) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::runSlot():"<<returnResult;
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return returnResult;
}


int CommunicateNormalDelegate::returnZeroSlot(int axisNum)
{
    usingMutex.lock();
    int returnResult=-1;
    if(soap_call_returnZeroPoint(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,axisNum,returnResult) == SOAP_OK)
    {
//        if(returnResult == 1)
//        {
//        }
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
     return returnResult;
}

int CommunicateNormalDelegate::returnZeroSlot()
{
    usingMutex.lock();
    qDebug()<<"CommunicateNormalDelegate returnZeroSlot()";
    int returnResult=-1;
    if(soap_call_returnAllZeroPoint(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnResult) == SOAP_OK)
    {
//        if(returnResult == 1)
//        {
//        }
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    return returnResult;
}



int CommunicateNormalDelegate::getLogFileInfo_Slot()
{
    usingMutex.lock();
    std::vector<struct Message> messagesLogOut;
    int result = soap_call_getRobotLogFileInfo(&hmiCommunicate->client_soap, (const char*)tmpServerIpArray.data(), "", tmpUserInfo, messagesLogOut);
    if(result == SOAP_OK)
    {
        isConnected=true;
        qDebug()<<"CommunicateNormalDelegate::getRobotLogFileInfo ==== true";
        // 获取成功
        QVector <struct Message> logInfo;
        logInfo.resize(messagesLogOut.size());
        for(int i=0; i < (int)messagesLogOut.size(); i++)
        {
            logInfo[i] = messagesLogOut[i];
        }
        emit sendLogFileInfo_Signal(logInfo);
    }
    else
    {
        isConnected=false;
        qDebug()<<"CommunicateNormalDelegate::getRobotLogFileInfo ==== false";
        emit showFileOperatDialog_signal(EM_MSG_BOX_SURE_BTN, tr("警号"), tr("获取控制器日志信息失败\n通信失败!"));
    }

    // 清理gsoap资源
    soap_destroy(&hmiCommunicate->client_soap);     // 清除反序列化的类实例
    soap_end(&hmiCommunicate->client_soap);         // 清理反序列化的数据(除类实例)和临时数据清理
    soap_done(&hmiCommunicate->client_soap);        // 重置和分离上下文:关闭网络连接和删除回调
    usingMutex.unlock(); return isConnected;

}

int CommunicateNormalDelegate::getCalibrateInformationSlot()
{
    usingMutex.lock();
    S_AXISGROUP_ZERO_INFORMATION zeroInformationOut;
    if(soap_call_getCalibrateInformation(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,zeroInformationOut) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::showCalibrateInfoSlot = ok";
        emit showCalibrateInfoSignal(zeroInformationOut);
    }
    else
    {

    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::allowCalibrateJogSlot(bool enable)
{
    usingMutex.lock();
    int returnFlag;
    if(soap_call_allowSingleAxisJog(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,enable,returnFlag) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::allowCalibrateJogSlot = ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

//int CommunicateNormalDelegate::calibrateOneAxisSlot(int axisId)
//{
//    usingMutex.lock();
//    int returnFlag;
//    if(soap_call_setSingleCaliber(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,axisId,returnFlag) == SOAP_OK)
//    {
//        qDebug()<<"CommunicateNormalDelegate::calibrateOneAxisSlot = ok";
//    }
//    else
//    {
//        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
//    }
//    soap_destroy(&hmiCommunicate->client_soap);
//    soap_end(&hmiCommunicate->client_soap);
//    soap_done(&hmiCommunicate->client_soap);
//    usingMutex.unlock(); return isConnected;
//}

int CommunicateNormalDelegate::updateTmpInfo(QString serverIP)
{
//    //if(hmiCommunicate->globalData->tryLock(TRYLOCKTIME))
//    {

//        tmpUserInfo.account = hmiCommunicate->globalData->userInfo.account;
//        tmpUserInfo.ip = hmiCommunicate->globalData->userInfo.ip;
//        tmpUserInfo.password = hmiCommunicate->globalData->userInfo.password;
//        tmpUserInfo.operationSystem = hmiCommunicate->globalData->userInfo.operationSystem;

////        qDebug() << "CommunicateNormalDelegate::updateTmpInfo tmpUserInfo.ip = " << QString::fromStdString(hmiCommunicate->globalData->userInfo.ip);
//        //hmiCommunicate->globalData->unlock();
//    }
    tmpUserInfo=hmiCommunicate->globalData->getUserInfo();
    tmpServerIp = serverIP;
    tmpServerIpArray = serverIP.toLatin1();
    return isConnected;
}

int CommunicateNormalDelegate::setUserInfo(UserInfo userInfoIn)
{
    tmpUserInfo=userInfoIn;
    return 1;
}

int CommunicateNormalDelegate::tryToConnect(QString hmiVersionInfo)
{
    usingMutex.lock();
    int returnResult;
    qDebug()<<"CommunicateNormalDelegate::tryToConnect()";
    qDebug()<<"ip:"<<QString::fromStdString(tmpUserInfo.ip);
    qDebug()<<"account:"<<tmpUserInfo.account;
    qDebug()<<"password:"<<QString::fromStdString(tmpUserInfo.password);
    qDebug()<<"operationSystem:"<<QString::fromStdString(tmpUserInfo.operationSystem);

    int soapResult=soap_call_loginController(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data()
                                             ,"",tmpUserInfo
                                             ,hmiVersionInfo.toStdString(),returnResult) ;
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    if(SOAP_OK==soapResult)
    {
        isLogIn=true;
        qDebug()<<"已经和服务器建立套接字，并通讯成功，登录反馈　returnResult"<<returnResult;
        emit sendConnectResult_signal(returnResult,"");

    }
    else
    {
        isLogIn=false;
        qDebug()<<"tryToConnect failed";
        qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
        emit sendConnectResult_signal(-1,QString(*soap_faultstring(&hmiCommunicate->client_soap)));
    }

    return returnResult;
}

int CommunicateNormalDelegate::findConnect()
{
    usingMutex.lock();
    qDebug()<<"CommunicateNormalDelegate::findConnect()";

    findIP.clear();
    //hmiCommunicate->globalData->lock();
    //hmiCommunicate->globalData->findFlag = true;//原子操作 不用加锁
    //hmiCommunicate->globalData->unlock();

    //findConnectTimer->start(100);

    int returnResult;
    for(int i = 2;i<255;i++)
    {
        if(hmiCommunicate->globalData->findFlag)
        {
            QString ip="10.1.21." + QString::number(ipNumber)+":"+tmpServerIp.right(4);
            QByteArray ba = ip.toLatin1();
            ipNumber++;

            if(soap_call_getTcpConnectState(&hmiCommunicate->client_soap,(const char*)ba.data(),"",tmpUserInfo,returnResult) == SOAP_OK)
            {
                if(returnResult == 1)
                {
                    findIP.append(ip);
                    emit sendFindConnectResult(findIP);
                }
            }
            else
            {
                qDebug()<<ip<<" error:"<<hmiCommunicate->client_soap.error<<","<<QString(*soap_faultstring(&hmiCommunicate->client_soap));
            }
            soap_destroy(&hmiCommunicate->client_soap);
            soap_end(&hmiCommunicate->client_soap);
            soap_done(&hmiCommunicate->client_soap);
        }
        else
        {
            qDebug()<<"find break";
            break;
        }

#ifndef BUILD_X86_WINDOWS
        usleep(5000);//5ms
#else
        //QThread::msleep(5);//5ms
//        QWaitCondition wait;
//        wait.wait(5);
        Sleep(5);
#endif

    }

    findIP.append("end");//搜索结束标志
    emit sendFindConnectResult(findIP);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::stopFindConnect()
{
    qDebug()<<"CommunicateNormalDelegate::stopFindConnect()";

    findIP.clear();
//    findFlag = false;

    //findConnectTimer->stop();
    return isConnected;
}

//int CommunicateNormalDelegate::findConnectTimeWork()
//{
//    //qDebug()<<"here";
//    int returnResult;

//    if(findFlag)
//    {
////        if(findCount == 10)//如果已经有10个
////        {
////            emit sendFindConnectResult(findIP);
////            findConnectTimer->stop();//停止 定时器
////            findCount = 0;
////            ipNumber = 2;

////            findFlag = false;//禁止 继续连接
////        }

//        if(255 ==  ipNumber )
//        {
////            if(findIP.isEmpty())
////            {
////                QString ip="127.0.0.1:" + tmpServerIp.right(4);
////                QByteArray ba = ip.toLatin1();
////                if(soap_call_getTcpConnectState(&hmiCommunicate->client_soap,(const char*)ba.data(),"",tmpUserInfo,returnResult) == SOAP_OK)
////                {
////                    if(returnResult == 1)
////                    {
////                        findIP.append(ip);
////                        emit sendFindConnectResult(findIP);
////                    }
////                }
////                else
////                {
////                    qDebug()<<ip<<" error:"<<hmiCommunicate->client_soap.error<<","<<
////                              QString(*soap_faultstring(&hmiCommunicate->client_soap));
////                    emit sendFindConnectResult(findIP);
////                }
////                soap_destroy(&hmiCommunicate->client_soap);
////                soap_end(&hmiCommunicate->client_soap);
////                soap_done(&hmiCommunicate->client_soap);
////            }
////            else
////            {
//                emit sendFindConnectResult(findIP);
////            }

//            findFlag = false;//禁止 继续连接
//            findConnectTimer->stop();//停止 定时器

//            findCount = 0;
//            ipNumber = 2;
//            findIP.clear();
//        }

//        findFlag = false;//先是禁止后来的定时器进行扫描操作

//        QString ip="10.1.21." + QString::number(ipNumber)+":"+tmpServerIp.right(4);
//        QByteArray ba = ip.toLatin1();
//        ipNumber++;

//        if(soap_call_getTcpConnectState(&hmiCommunicate->client_soap,(const char*)ba.data(),"",tmpUserInfo,returnResult) == SOAP_OK)
//        {
//            if(returnResult == 1)
//            {
//                findIP.append(ip);
//                findCount++;
//            }
//        }
//        else
//        {
//            qDebug()<<ip<<" error:"<<hmiCommunicate->client_soap.error<<","<<QString(*soap_faultstring(&hmiCommunicate->client_soap));
//        }
//        soap_destroy(&hmiCommunicate->client_soap);
//        soap_end(&hmiCommunicate->client_soap);
//        soap_done(&hmiCommunicate->client_soap);

//        findFlag = true;//本次返回结束后,回复允许扫描
//    }
//}

int CommunicateNormalDelegate::readDefaultFileNameSlot()
{
    usingMutex.lock();
    std::string returnName;
    if(soap_call_readDefaultFileName(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnName) == SOAP_OK)
    {
        QString tmpDefaultName = QString::fromStdString(returnName);
        qDebug()<<"***DefaultName*** :"<<tmpDefaultName;
        //
//        if(hmiCommunicate->globalData->tryLock(TRYLOCKTIME))
//        {
            //打开成功后
            hmiCommunicate->globalData->setDefaultUserProgramFileName(returnName);//获取 缺省名字
            //测试显示 返回给我的是一个 文件地址

//            hmiCommunicate->globalData->unlock();
//        }
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}


int ::CommunicateNormalDelegate::setLanguageSlot(int languageID)
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_setLanguage(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,languageID,returnResult) == SOAP_OK)
    {
        qDebug()<<"select language result ="<<returnResult;
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}


int CommunicateNormalDelegate::jogRunDogSlot()
{
    usingMutex.lock();
    int returnResult;

    if(soap_call_jogRunDog(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnResult) == SOAP_OK)
    {
//        if(returnResult == 1)
//        {
//        }
//        else
//        {
//        }
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}


int CommunicateNormalDelegate::setHandWheelSlot(int axisNumber,int direction,int velocity)
{
    usingMutex.lock();
    int returnResult;

    if(soap_call_setHandWheel(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo, axisNumber, direction, velocity,returnResult) == SOAP_OK)
    {

    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}


int CommunicateNormalDelegate::setRunLineSlot(int number)
{
    usingMutex.lock();
    int returnResult;

    if(soap_call_setProgramRunLine(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,number,returnResult) == SOAP_OK)
    {
        qDebug()<<"setRunLineSlot()*return:"<<returnResult;
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}


int CommunicateNormalDelegate::setAutoSpeedSlot(float setSpeed)
{
    usingMutex.lock();
    //qDebug()<<setSpeed;
    int returnResult;
    if(soap_call_setAutoSpeedPercent(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,setSpeed,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setManualSpeedSlot(float setSpeed)
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_setManualSpeedPercent(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,setSpeed,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setDebugModeSlot(int debugMode)
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_setDebugModel(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,debugMode,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setJointCoordinateSlot(int jointCoordinate)
{
    usingMutex.lock();
    int returnResult=-1;
    if(soap_call_setJogCoordinator(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,jointCoordinate,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return returnResult;
}

int CommunicateNormalDelegate::setControlMaunalModeSlot(int runModel)
{
    usingMutex.lock();
    qDebug()<<"set setControlMaunalModeSlot";
    int returnResult=-1;
    if(soap_call_setRunModel(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,runModel,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return returnResult;
}

int CommunicateNormalDelegate::setCurrentToolCoordSlot(int toolID)
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_setUToolActive(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,toolID,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setCurrentUserCoordSlot(int userID)
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_setUFrameActive(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,userID,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

//***run******************
int CommunicateNormalDelegate::cleanCurrentCounter()
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_setClearCurrentCounter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::cleanAllCounter()
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_setClearAllCounter(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setProgramRunLineSlot(int line)
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_setProgramRunLine(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,line,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::clearCurrentProductionSlot()
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_clearCurrentProduction(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnResult) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::clearCurrentProductionSlot ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::clearAccumulatedProductionSlot()
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_clearAccumulatedProduction(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnResult) == SOAP_OK)
    {
        qDebug()<<"CommunicateNormalDelegate::clearAccumulatedProductionSlot ok";
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

//***jog******************
//***pro******************
int CommunicateNormalDelegate::openFileCommSlot(QString fileName)
{
    if(0==fileName.size())
    {
        qDebug()<<"error ******openFileCommSlot fileName is empty";
        return 0;
    }
    usingMutex.lock();
    qDebug()<<"******openFileCommSlot fileName:"<<fileName;

    if(fileData.writeAllowFLag && fileData.readAllowFlag )
    {
        fileData.writeAllowFLag = false;
        fileData.readAllowFlag = false;
        int returnResult;
        if(soap_call_setProgramFileName(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,fileName.toStdString(),returnResult) == SOAP_OK)
        {
            qDebug()<<"******openFileCommSlot "<<returnResult;
            fileData.writeAllowFLag = true;
            fileData.readAllowFlag = true;
        }
        else
        {
            fileData.writeAllowFLag = true;
            fileData.readAllowFlag = true;
            //qDebug()<<"else file";
            //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
        }
        soap_destroy(&hmiCommunicate->client_soap);
        soap_end(&hmiCommunicate->client_soap);
        soap_done(&hmiCommunicate->client_soap);
    }
    else
    {
        qDebug()<<"******openFileCommSlot writeAllowFLag false";
    }
    usingMutex.unlock(); return isConnected;

}

int CommunicateNormalDelegate::saveFileAndUpdateCtrlSlot(QString fileName, QString md5)
{
    usingMutex.lock();
    qDebug()<<"******saveFileAndUpdateCtrlSlot name:"<<fileName;
    //clock_t start,finish;
    //start=clock();

    if(fileData.writeAllowFLag)
    {
        fileData.writeAllowFLag = false;
        int returnResult;
        if(soap_call_updateUserProgramFile(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,fileName.toStdString(),md5.toStdString(),returnResult) == SOAP_OK)
        {
            qDebug()<<"******saveFileAndUpdateCtrlSlot result:"<<returnResult;
            fileData.writeAllowFLag = true;
        }
        else
        {
            fileData.writeAllowFLag = true;
            //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
        }
        soap_destroy(&hmiCommunicate->client_soap);
        soap_end(&hmiCommunicate->client_soap);
        soap_done(&hmiCommunicate->client_soap);

        //finish=clock();
        //qDebug()<<"save file ********************** write program:"<<finish-start;
    }
    else
    {
        qDebug()<<"******saveFileAndUpdateCtrlSlot writeAllowFLag false";
    }
    usingMutex.unlock(); return isConnected;

}

int CommunicateNormalDelegate::changePointTypeSlot(PointPro inputPointPro)
{
    usingMutex.lock();
    PointPro returnPointPro;
    if(soap_call_changePointType(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,inputPointPro,returnPointPro) == SOAP_OK)
    {
//        qDebug()<<"jointFlag "<<returnPointPro.jointFlag;
//        qDebug()<<"pointNum "<<returnPointPro.pointNum;
//        qDebug()<<"groupNum "<<returnPointPro.groupNum;
//        qDebug()<<"ufValue "<<returnPointPro.ufValue;
//        qDebug()<<"utValue "<<returnPointPro.utValue;
//        qDebug()<<"recordStatus "<<returnPointPro.recordStatus;
//        qDebug()<<"configString "<<QString::fromStdString(returnPointPro.configString);
//        qDebug()<<"configInt "<<returnPointPro.configInt.size();
//        qDebug()<<"positionValue "<<returnPointPro.positionValue.size();
//        for(int i = 0;i <returnPointPro.positionValue.size();i++)
//        {
//            qDebug()<<"positionValue "<<returnPointPro.positionValue[i];
//        }
//        qDebug()<<"extPositionValue "<<returnPointPro.extPositionValue.size();

        //2017.05.24 点转换后的结果需要提取小数点位 补充
        for(int i = 0;i <returnPointPro.positionValue.size();i++)
        {
            returnPointPro.positionValue[i] = QString::number(returnPointPro.positionValue[i],'f',3).toFloat();
        }
        for(int i = 0;i <returnPointPro.extPositionValue.size();i++)
        {
            returnPointPro.extPositionValue[i] = QString::number(returnPointPro.extPositionValue[i],'f',3).toFloat();
        }

        emit sendProPointChangeResult(returnPointPro);
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

//***io*******************
int CommunicateNormalDelegate::setDoSlot(int number,bool value)
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_setDo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,number,value,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setSoSlot(int number,bool value)
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_setSo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,number,value,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setAoSlot(int number,float value)
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_setAo(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,number,value,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setGrSlot(int number,float value)
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_setGlobalRegister(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,number,value,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::cleanAllGrSLot()
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_clearAllGlobalRegister(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setRSlot(int number,float value)
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_setLocalRegister(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,number,value,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::cleanAllRSLot()
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_clearAllLocalRegister(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

//待定
int CommunicateNormalDelegate::recordPrSlot(int number,PointPro tmpPoint)
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_setPrRegister(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,number,tmpPoint,returnResult) == SOAP_OK)
    {
        qDebug()<<"recordPrSlot="<<returnResult;
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::changePrTypeSlot(int index, PointPro inputPointPro)
{
    usingMutex.lock();
    PointPro returnPointPro;
    if(soap_call_changePointType(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,inputPointPro,returnPointPro) == SOAP_OK)
    {
//        qDebug()<<"jointFlag "<<returnPointPro.jointFlag;
//        qDebug()<<"pointNum "<<returnPointPro.pointNum;
//        qDebug()<<"groupNum "<<returnPointPro.groupNum;
//        qDebug()<<"ufValue "<<returnPointPro.ufValue;
//        qDebug()<<"utValue "<<returnPointPro.utValue;
//        qDebug()<<"recordStatus "<<returnPointPro.recordStatus;
//        qDebug()<<"configString "<<QString::fromStdString(returnPointPro.configString);
//        qDebug()<<"configInt "<<returnPointPro.configInt.size();
//        qDebug()<<"positionValue "<<returnPointPro.positionValue.size();
//        qDebug()<<"extPositionValue "<<returnPointPro.extPositionValue.size();

        //数组下标 以及 点数据
        emit sendPrPointChangeResult(index,returnPointPro);
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setPlSlot(int number,float row,float col,float layer)
{
    usingMutex.lock();
    PlRegStruct tmp;
    tmp.row = row;
    tmp.col = col;
    tmp.layer = layer;

    int returnResult;
    if(soap_call_setPlRegister(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,number,tmp,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::cleanAllPlSlot()
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_clearAllPlRegister(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setTimeSlot(int number,int changeStatus)//尚无接口
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_setTimerRegister(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,number,changeStatus,returnResult) == SOAP_OK)
    {
        qDebug()<<"setTimeSlot Result = "<<returnResult;
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

//***msg******************
int CommunicateNormalDelegate::cleanMsgSLot(int msgID)
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_setMsgClear(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,msgID,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::cleanAllMsgSlot()
{
    usingMutex.lock();
    //qDebug()<<"clean all msg";
    int returnResult;
    if(soap_call_setAllMsgClear(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnResult) == SOAP_OK)
    {
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::clearMsgAndServoOn()
{
    cleanAllMsgSlot();
    #ifdef BUILD_X86_WINDOWS
    Sleep(1000);
    #else
    sleep(1);
    #endif

    int returnFlag;
    setAllManualServon(0,returnFlag);
    return returnFlag;
}

//int CommunicateNormalDelegate::setSingleCaliberSlot(int asixId)
//{
//    usingMutex.lock();
//    qDebug()<<"setAllCaliberSlot";
//    int returnResult;
//    if(soap_call_setSingleCaliber(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,asixId,returnResult) == SOAP_OK)
//    {
//    }
//    else
//    {
//        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
//    }
//    soap_destroy(&hmiCommunicate->client_soap);
//    soap_end(&hmiCommunicate->client_soap);
//    soap_done(&hmiCommunicate->client_soap);
//    usingMutex.unlock(); return isConnected;
//}

//int CommunicateNormalDelegate::setAllCaliberSlot()
//{
//    usingMutex.lock();
//    qDebug()<<"setAllCaliberSlot";
//    int returnResult;
//    if(soap_call_setAllCaliber(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,returnResult) == SOAP_OK)
//    {
//    }
//    else
//    {
//        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
//    }
//    soap_destroy(&hmiCommunicate->client_soap);
//    soap_end(&hmiCommunicate->client_soap);
//    soap_done(&hmiCommunicate->client_soap);
//    usingMutex.unlock(); return isConnected;
//}

int CommunicateNormalDelegate::changePasswordSlot(int acc,QString oldPass,QString newPass)
{
    usingMutex.lock();
    qDebug()<<"changePasswordSlot "<<oldPass<<" "<<newPass;
    int returnResult;
    if(soap_call_changePasswd(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,acc,oldPass.toStdString(),newPass.toStdString(),returnResult) == SOAP_OK)
    {
        qDebug()<<"changePasswordSlot "<<returnResult;
        emit changePasswdResult(returnResult);
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::changeCtrlIPSlot(ControllerIpGroupInfo tmpInfo)
{
    usingMutex.lock();
    //qDebug()<<"changeCtrlIPSlot "<<tmpInfo.ipAddress;
    int returnResult;
    if(soap_call_setIpAddress(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,tmpInfo,returnResult) == SOAP_OK)
    {
        qDebug()<<"changeCtrlIPSlot="<<returnResult;
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setRegisterNumberSlot(QString registerNumber)
{
    usingMutex.lock();
    struct ReturnRegisterStatus returnStatus;
    if(soap_call_setRegisterNumber(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,registerNumber.toStdString(),returnStatus) == SOAP_OK)
    {
        qDebug()<<"returnResult = "<<returnStatus.returnStatus;
        qDebug()<<"returnResult = "<<QString::fromStdString(returnStatus.returnLockTime);
        qDebug()<<"returnResult = "<<QString::fromStdString(returnStatus.returnRegisterNumber);
        emit sendRegisterResult(returnStatus);
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getToolCoordinateSlot(int robotID)
{
    usingMutex.lock();
    std::vector<HmiToolCoordinateInformation > recvToolCoordinate;
    if(soap_call_getToolCoordinateInformation(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,robotID,recvToolCoordinate) == SOAP_OK)
    {   
        fileData.toolInfo.clear();
        for(int i = 0;i<recvToolCoordinate.size();i++)
        {
            fileData.toolInfo.append(recvToolCoordinate[i]);

//            qDebug()<<"getToolCoordinateSlot index= "<<recvToolCoordinate[i].index;
        }
        emit sendToolCoordinateData(fileData.toolInfo);
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getUserCoordinateSlot(int robotID)
{
    usingMutex.lock();
    std::vector<HmiUserCoordinateInformation > recvUserCoordinate;
    if(soap_call_getUserCoordinateInformation(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,robotID,recvUserCoordinate) == SOAP_OK)
    {
        fileData.userInfo.clear();
        for(int i = 0;i<recvUserCoordinate.size();i++)
        {
            fileData.userInfo.append(recvUserCoordinate[i]);

//            qDebug()<<"getUserCoordinateSlot index= "<<recvUserCoordinate[i].index;
        }
        emit sendUserCoordinateData(fileData.userInfo);
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::calculateToolCoordinate(int robotID,HmiToolCoordinateInformation sendToolCoordinate)
{
    usingMutex.lock();
    qDebug()<<"sendToolCoordinate = "<<sendToolCoordinate.index;
    qDebug()<<"sendToolCoordinate = "<<sendToolCoordinate.method;
    for(int i = 0;i < sendToolCoordinate.pointList.size();i++)
    {
        qDebug()<<"sendToolCoordinate = "<<QVector<double>::fromStdVector(sendToolCoordinate.pointList[i].positionValue);
    }
    //qDebug()<<"sendToolCoordinate ut= "<<sendToolCoordinate.pointList[0].utValue;

    HmiToolCoordinateInformation recvToolCoordinate;
    if(soap_call_calculateToolCoordinate(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,robotID,sendToolCoordinate,recvToolCoordinate) == SOAP_OK)
    {
        qDebug()<<"recvToolCoordinate index = "<<recvToolCoordinate.index;
        qDebug()<<"recvToolCoordinate error = "<<recvToolCoordinate.error;
        qDebug()<<"recvToolCoordinate method = "<<recvToolCoordinate.method;
        for(int i = 0;i<recvToolCoordinate.xyzwpr.size();i++)
        {
            qDebug()<<"recvToolCoordinate xyzwpr = "<<recvToolCoordinate.xyzwpr[i];
        }

        emit sendToolCalculateData(recvToolCoordinate);

    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}


int CommunicateNormalDelegate::calculateUserCoordinate(int robotID, HmiUserCoordinateInformation sendUserCoordinate)
{
    usingMutex.lock();
    qDebug()<<"sendUserCoordinate = "<<sendUserCoordinate.index;
    qDebug()<<"sendUserCoordinate = "<<sendUserCoordinate.method;
    for(int i = 0;i < sendUserCoordinate.pointList.size();i++)
    {
        qDebug()<<"sendUserCoordinate = "<<QVector<double>::fromStdVector(sendUserCoordinate.pointList[i].positionValue);
    }
    //qDebug()<<"sendUserCoordinate ut= "<<sendUserCoordinate.pointList[0].utValue;

    HmiUserCoordinateInformation recvUserCoordinate;
    if(soap_call_calculateUserCoordinate(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,robotID,sendUserCoordinate,recvUserCoordinate) == SOAP_OK)
    {
        qDebug()<<"recvUserCoordinate = "<<recvUserCoordinate.index;
        qDebug()<<"recvUserCoordinate = "<<recvUserCoordinate.method;
        for(int i = 0;i<recvUserCoordinate.xyzwpr.size();i++)
        {
            qDebug()<<"recvUserCoordinate = "<<recvUserCoordinate.xyzwpr[i];
        }

        emit sendUserCalculateData(recvUserCoordinate);
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}


int CommunicateNormalDelegate::changeAxisLimitSlot(QVector<AxisLimit> changeLimit)
{
    usingMutex.lock();
    int returnResult;
    if(soap_call_changeAxisLimit(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,changeLimit.toStdVector(),returnResult) == SOAP_OK)
    {
        qDebug()<<"returnResult = "<<returnResult;
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getStoreStatusSlot()
{
    usingMutex.lock();
    StoreStatus tmpStatus;
    if(soap_call_getStoreStatus(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,tmpStatus) == SOAP_OK)
    {
        qDebug()<<"tmpStatus = "<<tmpStatus.wholeDiskMemory;
        qDebug()<<"tmpStatus = "<<tmpStatus.usedDiskMemory;
        qDebug()<<"tmpStatus = "<<tmpStatus.wholeSystemMemory;
        qDebug()<<"tmpStatus = "<<tmpStatus.usedSystemMemory;
    }
    else
    {
        //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::controllerShutDownEnableSlot(bool enable)
{
    usingMutex.lock();
    int result;
    if(soap_call_controlShutDownEnable(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,enable,result) == SOAP_OK)
    {
        qDebug()<<"soap_call_controlShutDownEnable ok ";
    }
    else
    {
        qDebug()<<"soap_call_controlShutDownEnable failed ";
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setStartTypeSlot(int type)
{
    usingMutex.lock();
    std::string result;
    if(soap_call_setStartType(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,type,result) == SOAP_OK)
    {

    }
    else
    {

    }
    //qDebug("soap error:%d,%s,%s", hmiCommunicate->client_soap.error, *soap_faultcode(&hmiCommunicate->client_soap), *soap_faultstring(&hmiCommunicate->client_soap) );
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::shutDownSlot()
{
    usingMutex.lock();
    int result;
    if(soap_call_controllerShutDown(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,result) == SOAP_OK)
    {
        emit shutDownStart(result);//hmi 关机允许与否
        qDebug()<<"ShutDown result = "<<result;
    }
    else
    {}
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}


int CommunicateNormalDelegate::connectVrep(QString ip, int port )
{
    usingMutex.lock();
    int result;
    if(soap_call_connectVrep(&hmiCommunicate->client_soap,
                             (const char*)tmpServerIpArray.data(),"",
                             tmpUserInfo,ip.toStdString().data(),port,result) == SOAP_OK)
    {
        qDebug()<<"connectVrep result = "<<result;
    }
    else
    {}
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::disconnectVrep( )
{
    usingMutex.lock();
    int result;
    if(soap_call_disconnectVrep(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,result) == SOAP_OK)
    {
        qDebug()<<"disconnectVrep result = "<<result;
    }
    else
    {}
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setVrepServoType(int type)
{
    usingMutex.lock();
    int result;
    if(soap_call_setVrepServoType(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,type,result) == SOAP_OK)
    {
        qDebug()<<"setVrepServoType result = "<<result;
    }
    else
    {}
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::setVrepIoType(int type)
{
    usingMutex.lock();
    int result;
    if(soap_call_setVrepIoType(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",tmpUserInfo,type,result) == SOAP_OK)
    {
        qDebug()<<"setVrepIoType result = "<<result;
    }
    else
    {}
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::backupFile(int backUpType, int diskType, 
                                          std::string fileName, int robotId, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_backupFile(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",
                            tmpUserInfo,backUpType,diskType,fileName,robotId,returnFlag) == SOAP_OK)
    {
        qDebug()<<"backupFile resultReturn = "<<returnFlag;
        
    }
    else
    {
        
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::restoreFile(int backUpType, int diskType, std::string fileName, int robotId, int &returnFlag)
{
    usingMutex.lock();
    if(soap_call_restoreFile(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data(),"",
                            tmpUserInfo,backUpType,diskType,fileName,robotId,returnFlag) == SOAP_OK)
    {
        qDebug()<<"restoreFile resultReturn = "<<returnFlag;
        
    }
    else
    {
        
    }
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock(); return isConnected;
}

int CommunicateNormalDelegate::getFileList(int pathType, std::vector<std::string> &fileList)
{
    usingMutex.lock();
    qDebug()<<"CommunicateNormalDelegate::getFileList()";
    qDebug()<<"ip:"<<QString::fromStdString(tmpUserInfo.ip);
    qDebug()<<"account:"<<tmpUserInfo.account;
    qDebug()<<"password:"<<QString::fromStdString(tmpUserInfo.password);
    qDebug()<<"operationSystem:"<<QString::fromStdString(tmpUserInfo.operationSystem);
    //coredump
    int key=soap_call_getFileList(&hmiCommunicate->client_soap,(const char*)tmpServerIpArray.data()
                                  ,"",tmpUserInfo,pathType,fileList);
    soap_destroy(&hmiCommunicate->client_soap);
    soap_end(&hmiCommunicate->client_soap);
    soap_done(&hmiCommunicate->client_soap);
    usingMutex.unlock();
    if( key== SOAP_OK)
    {
        qDebug()<<"sucess getFileList ="<<key;

    }
    else
    {
        qDebug()<<"failed getFileList ="<<key;
    }

    return isConnected;
}
